﻿
@using Kooboo.CMS.Content.Models;
@using Kooboo.CMS.Content.Query;
@{ var schema = (Kooboo.CMS.Content.Models.Schema)ViewData["Schema"];
    var allowedEdit = (bool)ViewData["AllowedEdit"];
    var allowedView = (bool)ViewData["AllowedView"];}
@using(Html.BeginForm(ViewContext.RequestContext.AllRouteValues()["action"].ToString()
    , ViewContext.RequestContext.AllRouteValues()["controller"].ToString()
    , ViewContext.RequestContext.AllRouteValues()
    , FormMethod.Post
    , new RouteValueDictionary(new { enctype = "application/x-www-form-urlencoded" })))
{
    <div class="common-form">
    <fieldset>
    <table><tr>
            <td>
            <label for="Title">Başlık</label><a href="javascript:;" class="tooltip-link" title='Başlık Metni'></a>
            </td>
            <td>
            <input id="Title" name="Title" type="text" value="@(Model.Title ?? "")"  data-val-required="The Title field is required." data-val="true"/>
            @Html.ValidationMessageForColumn(((ISchema)ViewData["Schema"])["Title"], null)
            </td>          
            </tr><tr>
            <td>
            <label for="Summary">&#214;zet</label><a href="javascript:;" class="tooltip-link" title='&#214;zet Metni'></a>
            </td>
            <td>
            <textarea name="Summary" rows="10" cols="100"  data-val-required="The Summary field is required." data-val="true">@(Model.Summary ?? "")</textarea> 
            @Html.ValidationMessageForColumn(((ISchema)ViewData["Schema"])["Summary"], null)
            </td>          
            </tr><tr>
            <td>
            <label for="Description">A&#231;ıklama</label><a href="javascript:;" class="tooltip-link" title='A&#231;ıklama Metni'></a>
            </td>
            <td>
            
<textarea name="Description" id="Description" class="Description tinymce" media_library_url="@Url.Action("Selection","MediaContent",ViewContext.RequestContext.AllRouteValues()))"  media_library_title ="@("Selected Files".Localize())" rows="10" cols="100">@( Model.Description ?? "")</textarea>

            @Html.ValidationMessageForColumn(((ISchema)ViewData["Schema"])["Description"], null)
            </td>          
            </tr><tr>
            <td>
            <label for="Body">İ&#231;erik</label><a href="javascript:;" class="tooltip-link" title='İ&#231;erik Metni'></a>
            </td>
            <td>
            
<textarea name="Body" id="Body" class="Body tinymce" media_library_url="@Url.Action("Selection","MediaContent",ViewContext.RequestContext.AllRouteValues()))"  media_library_title ="@("Selected Files".Localize())" rows="10" cols="100">@( Model.Body ?? "")</textarea>

            @Html.ValidationMessageForColumn(((ISchema)ViewData["Schema"])["Body"], null)
            </td>          
            </tr>
            @if (allowedEdit) {
                <tr>
            <td>
            <label for="Published">Published</label>
            </td>
            <td>
            <input name="Published" type="checkbox" @(Convert.ToBoolean(Model.Published)?"checked":"") value="true"/>
                                    <input type="hidden" value="false" name="Published"/>
            @Html.ValidationMessageForColumn(((ISchema)ViewData["Schema"])["Published"], null)
            </td>          
            </tr>
            }
    @Html.Action("Categories", ViewContext.RequestContext.AllRouteValues())
    </table>
    </fieldset>
    <p class="buttons"><button type="submit">@("Save".Localize())</button> <a href="javascript:;" class="dialog-close button">@("Close".Localize())</a> </p>
    </div>
}